/**
 * @mbggenerated
 * @author wujian
 */
package bearworker.zxl.dao.mapper;

import bearworker.zxl.entity.DeliveryLogisticsInformation;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface DeliveryLogisticsInformationMapper {
    /* @mbggenerated */
    @Delete({
        "delete from delivery_logistics_information",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /* @mbggenerated */
    @Insert({
        "insert into delivery_logistics_information (id, courier_number, ",
        "state, state_detail, ",
        "state_time, create_time)",
        "values (#{id,jdbcType=INTEGER}, #{courierNumber,jdbcType=VARCHAR}, ",
        "#{state,jdbcType=VARCHAR}, #{stateDetail,jdbcType=VARCHAR}, ",
        "#{stateTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP})"
    })
    int insert(DeliveryLogisticsInformation record);

    /* @mbggenerated */
    @InsertProvider(type=DeliveryLogisticsInformationSqlProvider.class, method="insertSelective")
    int insertSelective(DeliveryLogisticsInformation record);

    /* @mbggenerated */
    @Select({
        "select",
        "id, courier_number, state, state_detail, state_time, create_time",
        "from delivery_logistics_information",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="courier_number", property="courierNumber", jdbcType=JdbcType.VARCHAR),
        @Result(column="state", property="state", jdbcType=JdbcType.VARCHAR),
        @Result(column="state_detail", property="stateDetail", jdbcType=JdbcType.VARCHAR),
        @Result(column="state_time", property="stateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP)
    })
    DeliveryLogisticsInformation selectByPrimaryKey(Integer id);

    /* @mbggenerated */
    @UpdateProvider(type=DeliveryLogisticsInformationSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(DeliveryLogisticsInformation record);

    /* @mbggenerated */
    @Update({
        "update delivery_logistics_information",
        "set courier_number = #{courierNumber,jdbcType=VARCHAR},",
          "state = #{state,jdbcType=VARCHAR},",
          "state_detail = #{stateDetail,jdbcType=VARCHAR},",
          "state_time = #{stateTime,jdbcType=TIMESTAMP},",
          "create_time = #{createTime,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(DeliveryLogisticsInformation record);
    
    @Select({
        "select",
        "id, courier_number, state, state_detail, state_time, create_time",
        "from delivery_logistics_information",
        "where courier_number = #{courierNumber,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="courier_number", property="courierNumber", jdbcType=JdbcType.VARCHAR),
        @Result(column="state", property="state", jdbcType=JdbcType.VARCHAR),
        @Result(column="state_detail", property="stateDetail", jdbcType=JdbcType.VARCHAR),
        @Result(column="state_time", property="stateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<DeliveryLogisticsInformation> selectBycourierNumber(String courierNumber);
}